<link href="${rc.getContextPath()}/manage/css/dwzCustomCss/dwz.custom.css?v=${ver}" rel="stylesheet" type="text/css">

<div class="pageContent" id="jGridForRecipient"></div>

<script type="text/javascript">
(function($){
    var postData = {
        navTabId: '${navTabId}',
        userCode: '{userCode}', 
        storageLocationCode: '{storageLocationCode}',
        materialCode: '{materialCode}',
        hasWarehouse: function (trData) {
            return trData.warehouseCode != null && trData.warehouseCode != '';
        },
        hasMaterialType: function(trData) {
            if (trData.warehouseCode == null || trData.warehouseCode == '') {
                return trData.materialTypeCode != null && trData.materialTypeCode != ''; 
            }
            return false;
        }
    };
    
    $('#jGridForRecipient').jGrid({
        layoutH: 165,
        width: 1500,
        base: '${rc.getContextPath()}/manage/inventoryAlarmRecipient/',
        url: 'selectRecipientList',
        columns: [
            {field: 'id', group: 'ids', type: 'checkbox', width: 22},
            {field: '_index', text: '<@label key="serialNumber.C">序号</@label>', width: 40},
            {field: 'userCode', text: '用户名', width: 100, query: true, orderTable: 'i'},
            {field: 'storageLocationCode', text: '库位编号', width: 100, query: true, orderTable: 'i'},
            {field: 'warehouseCode', text: '仓库编号', width: 100, orderTable: 'i', query: true},
            {field: 'warehouseText', text: '仓库描述', width: 100},
            {field: 'materialTypeCode', text: '物料类型编号', width: 100, orderTable: 'i', query: true},
            {field: 'materialTypeText', text: '物料类型描述', width: 100},
            {field: 'materialCode', text: '物料编号', width: 100, orderTable: 'i', query: true},
            {field: 'materialText', text: '物料描述', width: 100},
            {field: 'lockFlag', text: '<@label key="lockFlag.C">锁定标记</@label>', width: 80, orderTable: 'i', transform: function(data){
                if (data == 0) {
                    return '<@label    key="no.C">否</@label>';
                } else if (data == 1) {
                    return '<@label    key="yes.C">是</@label>';
                }
            }, query: true, queryType: 'select', queryOptions: [
                {value: '', label: '<@label key="all.C">所有</@label>'},
                {value: 0, label: '<@label key="no.C">否</@label>'},
                {value: 1, label: '<@label key="yes.C">是</@label>'}
            ]},
            {field: 'createUser', text: '<@label key="createUser.C">创建人</@label>', width: 100, orderTable: 'i'},
            {field: 'createDateTime', type: 'date', format: 'yyyy-MM-dd HH:mm:ss', text: '<@label key="createDateTime.C">创建时间</@label>', width: 150, orderTable: 'i'},
            {field: 'modifyUser', text: '<@label key="modifyUser.C">修改人</@label>', width: 100, orderTable: 'i'},
            {field: 'modifyDateTime', type: 'date', format: 'yyyy-MM-dd HH:mm:ss', text: '<@label key="modifyDateTime.C">修改时间</@label>', width: 150, orderTable: 'i'}
        ],
        gridbars: [
            {icon: 'add', text: '<@label key="add.B">新增</@label>', title: '新增报警接收人信息', 
                target: 'dialog', href: 'addRecipient', data: {navTabId: "${navTabId!''}"}, mask: true, width: 634, height: 410,
                menuCode: "moveType_add"},
            {icon: 'edit', text: '<@label key="edit.B">编辑</@label>', title: "编辑报警接收人信息", 
                target: 'dialog', href: 'modifyRecipients', data: postData, mask: true, width: 634, height: 410, rel: '', callback: $.noop,
                menuCode: "moveType_edit"},
            {icon: 'icon', text: '<@label key="view.B">详情</@label>', title: "报警接收人信息详情", 
                target: 'dialog', href: 'viewRecipients', data: postData, mask: true, width: 634, height: 410, callback: $.noop,
                menuCode: "moveType_view"},
            {icon: 'delete', text: '<@label key="delete.B">删除</@label>', title: "确认要删除选择的报警接收人信息吗？", 
                target: 'selectedTodo', href: 'deleteInventoryAlarmRecipient', data: {ids: '{ids}', navTabId: '${navTabId!""}'},
                menuCode: "moveType_del"}
        ]
    });
})(jQuery);
</script>